(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/member/address-edit/address-edit" ], {
    "0396": function(e, a, o) {
        o.d(a, "b", function() {
            return i;
        }), o.d(a, "c", function() {
            return t;
        }), o.d(a, "a", function() {
            return n;
        });
        var n = {
            pickRegions: function() {
                return Promise.all([ o.e("common/vendor"), o.e("components/pick-regions/pick-regions") ]).then(o.bind(null, "dcf4"));
            }
        }, i = function() {
            this.$createElement, this._self._c;
        }, t = [];
    },
    "4b23": function(e, a, o) {
        var n = o("a0cd");
        o.n(n).a;
    },
    "54d9": function(e, a, o) {
        (function(e) {
            Object.defineProperty(a, "__esModule", {
                value: !0
            }), a.default = void 0;
            var n = {
                components: {
                    pickRegions: function() {
                        Promise.all([ o.e("common/vendor"), o.e("components/pick-regions/pick-regions") ]).then(function() {
                            return resolve(o("dcf4"));
                        }.bind(null, o)).catch(o.oe);
                    }
                },
                data: function() {
                    return {
                        type: 0,
                        content: "",
                        payload: {
                            name: "",
                            phone: "",
                            mobile: "",
                            province: "",
                            city: "",
                            area: "",
							address: "",
							addr: "",
							getAddr: "",
                            lat: "",
							lng: "",
							tc:0,
                            is_default: "0",
                            mode: ""
                        },
						mode: "",
						tc:0,
                        defaultRegion: []
                    };
                },
                methods: {
                    handleGetRegion: function(e) {
                        this.payload.province = e[0].name, this.payload.city = e[1].name, this.payload.area = e[2].name;
                    },
                    changeDefault: function(e) {
                        var a = e.detail.value;
                        this.payload.is_default = a ? "1" : "0";
                    },
                    changeRegion: function(e) {
                        var a = e.detail.value;
                        this.payload.province = a[0], this.payload.city = a[1], this.payload.area = a[2];
					},
					add1: function(t) {
						console.log('add1',t);
						var e = this;
						wx.chooseLocation({
							type: "gcj02",
							success: function(t) {
								console.log('wx.chooseLocation',t);
								e.payload.addr = t.name,
								e.payload.address = t.address,
								e.payload.lat =  t.latitude,
								e.payload.lng =  t.longitude
							},
							fail:function(t){
								console.log('fail',t);
							}
						});
					},
                    aiarea: function() {
                        var e = this;
                        this.content && this.$api.aiareaApi({
                            content: this.content
                        }, function(a) {
                            if ("1" == a.code) {
                                var o = a.data;
								e.payload.name = o.name, 
								e.payload.phone = o.phone, 
								e.payload.mobile = o.mobile ? o.mobile : "", 
								e.payload.province = o.province, 
								e.payload.city = o.city, 
								e.payload.area = o.area, 
								e.payload.address = o.addr, 
								e.payload.addr = o.addr, 
								e.payload.getAddr = o.getAddr, 
								e.payload.mode = e.mode,
								e.payload.lat = o.lat,
								e.payload.lng = o.lng,
								e.payload.tc = e.tc, 
								e.payload.mode = e.mode, 
								e.defaultRegion = [ o.province, o.city, o.area ];
                            } else e.$common.errorToShow(a.msg);
                        });
                    },
                    submit: function() {
                        var a = this, o = 0 === this.type ? this.$api.areaAddApi : this.$api.areaEditApi;
                        if (0 === this.type && (this.payload.mode = this.mode), this.payload.address.length >= 45) this.$common.errorToShow("您填写的详细地址超长影响下单，请精简后再提交！"); else if (this.payload.phone || this.payload.mobile) {
                            var n = {
                                name: this.payload.name,
                                province: this.payload.province,
                                city: this.payload.city,
								area: this.payload.area,
								lat: this.payload.lat,
								lng: this.payload.lng,
								addr: this.payload.addr,
								getAddr: this.payload.getAddr,
                                address: this.payload.address
                            };
                            this.$common.validate({
                                name: {
                                    name: "联系人姓名"
                                },
                                address: {
                                    name: "详细地址"
                                }
                            }, n) && o(this.payload, function(o) {
                                "1" == o.code ? a.$common.successToShow(o.msg, function() {
                                    e.navigateBack();
                                }) : a.$common.errorToShow(o.msg);
                            });
                        } else this.$common.errorToShow("手机号码和固定电话二者必填一项！");
                    }
                },
                onLoad: function(a) {
                    var o = this;
                    this.$forceUpdate();
					var n = a.id, i = void 0 === n ? "" : n, t = a.mode, d = void 0 === t ? "" : t, r = "";
					this.tc = a.tc;
					this.payload.tc = a.tc;

                    1 == d ? r = "寄件地址" : 2 == d && (r = "收件地址"), this.mode = d, "" !== i ? (this.type = 1, 
                    this.$api.getUserAreaApi({
                        id: i
                    }, function(e) {
                        if ("1" == e.code) {
                            var a = e.data.info, n = {
                                addr_id: i,
                                name: a.sender_name,
                                phone: a.sender_phone,
                                mobile: a.sender_mobile,
                                province: a.sender_province,
                                city: a.sender_city,
                                area: a.sender_area,
                                lat: a.lat,
								lng: a.lng,
								tc: a.tc,
								address: a.address,
								addr: a.addr,
								getAddr: a.getAddr,
                                is_default: a.is_default + "",
                                mode: a.mode
                            };
                            o.payload = n, o.defaultRegion = [ n.province, n.city, n.area ];
                        } else o.$common.errorToShow(e.msg);
                    })) : this.type = 0, e.setNavigationBarTitle({
                        title: 0 === this.type ? "添加" + r : "编辑" + r
                    });
				},
				onShow: function() {
					var _that = this;
					this.tc != 9 && wx.getClipboardData({
						success: function (res) {
							e.showModal({
								content: "检测到剪切板内容，是否粘贴？",
								success: function(e) {
									_that.content=res.data;
								}
							});
						}
					})
				}
            };
            a.default = n;
        }).call(this, o("543d").default);
    },
    a0cd: function(e, a, o) {},
    ac5d: function(e, a, o) {
        (function(e) {
            o("98af"), n(o("66fd"));
            var a = n(o("f3d2"));
            function n(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = o, e(a.default);
        }).call(this, o("543d").createPage);
    },
    e17e: function(e, a, o) {
        o.r(a);
        var n = o("54d9"), i = o.n(n);
        for (var t in n) "default" !== t && function(e) {
            o.d(a, e, function() {
                return n[e];
            });
        }(t);
        a.default = i.a;
    },
    f3d2: function(e, a, o) {
        o.r(a);
        var n = o("0396"), i = o("e17e");
        for (var t in i) "default" !== t && function(e) {
            o.d(a, e, function() {
                return i[e];
            });
        }(t);
        o("4b23");
        var d = o("f0c5"), r = Object(d.a)(i.default, n.b, n.c, !1, null, "3c265906", null, !1, n.a, void 0);
        a.default = r.exports;
    }
}, [ [ "ac5d", "common/runtime", "common/vendor" ] ] ]);